// components/diy/banner/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    diyPramas:{
      type:Object
    },
    diyStyle:{
      type:Object
    },
    diyData:{
      type:Object
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    slider: {},
    swiperCurrent: 0
  },

  /**
   * 组件的方法列表
   */
  methods: {
      //轮播图的切换事件
      swiperChange: function(e){
        //只要把切换后当前的index传给<swiper>组件的current属性即可
        this.setData({
          swiperCurrent: e.detail.current
        })
      },
      
      //点击指示点切换
      chuangEvent: function(e){
        this.setData({
          swiperCurrent: e.currentTarget.id
        })
      }
  },
  lifetimes:{
    ready(){
      this.setData({
        slider: this.properties.diyData
      })
    }
  }
})
